﻿<!DOCTYPE html>
<html class="x-admin-sm">

<head>
    <meta charset="UTF-8">

    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
        content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />



    <link rel="stylesheet" href="../content/css/font.css">
    <link rel="stylesheet" href="../content/css/xadmin.css">
    <link rel="stylesheet" href="../content/plugin/bootstrap/css/bootstrap.min.css">
    <link rel='stylesheet' href='../content/plugin/bootstrap/css/style.css' />

    <script src="../content/js/jquery-1.10.2.min.js"></script>

    <script type="text/javascript" src="../content/js/xadmin.js"></script>
    <script type="text/javascript" src="../content/js/cookie.js"></script>
    <script src="../content/lib/layui/layui.js" charset="utf-8"></script>
    <link rel="stylesheet" href="../content/plugin/FileUpload/css/jquery.fileupload.css" />




</head>

<body>
    <div id="app">
        <div class="x-nav">

            <span class="nav-header">
                <a href="">代理报表</a>


            </span>

        </div>
        <div class="x-body">


            <div class="layui-row">
                代理名称：
                <input type="text" name="" placeholder="" v-model="search.name" autocomplete="off"
                    style="height:30px;width: 100px;">

                日期：
                <div class="layui-input-inline">
                    <input type="text" class="layui-input" id="mydate" placeholder=" - ">

                </div>
                <button class="layui-btn" v-on:click="getdata"><i class="layui-icon">&#xe615;</i></button>




            </div>
            <hr />

            <div class="table-responsive">
                <table id="tableExcel" class="table table-bordered table-hover">
                    <thead>
                        <tr>
                            <th class="noExl"> 代理名称</th>
                            <th>今日订单</th>
                            <th>今日销售额</th>
                            <th>总订单</th>
                            <th>总销售额</th>

                            <th>操作</th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr v-for="uitem in arrayData">
                            <td class="noExl">{{uitem.sitename}}</td>
                            <td>{{uitem.ordernum_day}}</td>
                            <td>{{uitem.paymoney_day}}</td>
                            <td>{{uitem.ordernum}}</td>
                            <td>{{uitem.paymoney}}</td>

                            <td>
                                <a @click="goorder(uitem)">查看订单</a>
                            </td>
                        </tr>
                    </tbody>
                </table>
            </div>


        </div>





    </div>
    <link href="../content/plugin/sweetalert/sweetalert.css" rel="stylesheet">
    <script src="../content/plugin/sweetalert/sweetalert.min.js"></script>
    <script src="../content/plugin/bootstrap/js/bootstrap.min.js"></script>
    <script src="../content/js/vue2.js"></script>
    <script src="../content/js/vue-nav.js"></script>
    <script src="../content/js/config.js"></script>





    <script>


        var timeScope;

        layui.use('laydate', function () {
            var laydate = layui.laydate;
            timeScope = laydate.render({
                elem: '#mydate'
                , range: true
                , ready: function (date) {
                    console.log("1", date); //得到初始的日期时间对象：{year: 2017, month: 8, date: 18, hours: 0, minutes: 0, seconds: 0}
                }
            });

        });
        Array.prototype.remove = function (val) {
            var index = this.indexOf(val);
            if (index > -1) {
                this.splice(index, 1);
            }
        };
        var vm = new Vue({
            el: "#app",
            data: {
                all: 0,
                search: {
                    page: 1,
                    size: 10,
                    mid: localStorage.getItem("mid"),
                    order_no: "",
                    truename: "",
                    stime: "",
                    etime: "",
                    pay_status: "",
                    phone: "",
                    order_status: ""
                },
                arrayData: [],
                allcount: 0,
                info: {},
                menulist: [],
                addobj: {
                    parentid: 0
                },
                editobj: {},
                datalist: [],
                statelist: [{ "id": 1, "name": "是" }, { "id": 0, "name": "否" }],
                paystatelist: [{ "id": 1, "name": "待付款" }, { "id": 2, "name": "待发货" }, { "id": 3, "name": "待收货" }, { "id": 4, "name": "待评价" }, { "id": 5, "name": "交易成功" }],
                wuliulist: [],
                order_status: "",
                paymoney: 0,
                paymoney_day: 0,
                paymoney_month: 0
            },
            components: {
                'vue-nav': Vnav
            },
            filters: {
                tochina(value) {


                    return parseInt(value * parseFloat(0.061));
                },

            },
            methods: {
                downloadxls() {
                    window.open("/admin/content/xls/导入模板.xls");
                },
                importdata() {

                },

                check() {
                    if (localStorage.getItem("mid") == "0") {
                        return true;
                    } else {
                        return false;
                    }
                },
                searchdata: function () {
                    this.search.page = 1;
                    this.getdata();
                },
                goorder: function (uitem) {
                    location.href = "dailiorder.html?mid=" + uitem.userid;
                },

                getdata: function (_keycontent) {  //查询数据

                    var self = this;

                    var stime = $("#mydate").val().split(" - ")[0];
                    var etime = $("#mydate").val().split(" - ")[1];

                    if (stime == undefined) {
                        stime = "";
                    }
                    if (etime == undefined) {
                        etime = "";
                    }
                    this.search.stime = stime;
                    this.search.etime = etime;

                    $.post(apiurl + "/admin/dian/apply/tj", this.search, function (_result) {
                        console.log(_result);
                        self.arrayData = _result.data;
                        self.all = _result.allcount;
                        self.allcount = _result.count;
                    });

                },



            },
            created: function () {  //初始化事件里边去调用查询方法



                this.getdata("");



            }
        });


    </script>
</body>

</html>